#ifndef _IRCODE_H_
#define _IRCODE_H_

//typedef struct {
//	uint16_t forestClocks;
//	uint16_t flatTime;
//} bit_time_t;
//
//typedef struct {
//	uint16_t carrierClockHighDelayUs;	
//	uint16_t carrierClockLowDelayUs;
//	uint16_t isLSB;
//	uint16_t sendStartBit;
//	uint16_t sendStopBit;
//	bit_time_t startBit;
//	bit_time_t stopBit;
//	bit_time_t logicalBit1;
//	bit_time_t logicalBit0;
//} ir_code_t;

typedef enum {
	LSB_FORMAT,
	MSB_FORMAT,
} data_format_t;

typedef struct {
	uint16_t forestTime;
	uint16_t plainTime;
} ir_bit_time_t;

typedef struct {
	uint16_t carrierFreq;
	uint16_t carrierDuty;
	uint16_t dataFormat;
	ir_bit_time_t startBit;
	ir_bit_time_t stopBit;
	ir_bit_time_t logicalBit1;
	ir_bit_time_t logicalBit0;
} ir_coding_t;

void IRWrite(const char *buffer, int numberOfBits);
void IRUSBWrite(const char *usbDataBuffer, int len);
int IRCodingConfig(const char *buffer, int len);

#endif
